package com.fedex.longitude.editor;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;

public class DashboardEditor extends EditorPart {

	public static String ID = "com.fedex.longitude.editor.DashboardEditor";
	
	private Text _transcript;
	
	public DashboardEditor(){}
	
	@Override
	public void doSave(IProgressMonitor monitor) {
		// TODO Auto-generated method stub

	}

	@Override
	public void doSaveAs() {

	}

	@Override
	public void init(IEditorSite site, IEditorInput input)
			throws PartInitException {
		setSite(site);
		setInput(input);
		setPartName("Dashboard");
	}

	@Override
	public boolean isDirty() {
		return false;
	}

	@Override
	public boolean isSaveAsAllowed() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void createPartControl(Composite parent) {
		Composite top = new Composite(parent, SWT.None);
		GridLayout layout = new GridLayout();
		layout.marginWidth = 0;
		layout.marginHeight = 0;
		top.setLayout(layout);
		
		_transcript = new Text(top, SWT.BORDER | SWT.MULTI | SWT.WRAP);
		_transcript.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
		_transcript.setEditable(false);
		_transcript.setBackground(_transcript.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
		_transcript.setForeground(_transcript.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
	}

	@Override
	public void setFocus() {
	}

}
